public class 函数声明 {

    public static int fun1(int a) throws NullPointerException, ArithmeticException {
        return 10 / a;
    }

    public static void main(String[] args) {
        try {
            System.out.println(fun1(0));
        } catch (NullPointerException e) {
            System.out.println("调用出错");
        } catch (ArithmeticException e) {
            System.out.println("---");
        } finally {
            System.out.println("----x");
        }
        System.out.println("xx");
    }

}
